<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>axios</title>
  </head>
  <body>
    <pre></pre>
    <script src="../node_modules/axios/dist/axios.js"></script>
    <script>
      async function test() {
        const val1 = await axios.get('http://localhost:3000/axios', {
          params: {
            id: '我用params发送的id',
          },
        })
        var val2 = await axios
          .get('http://localhost:3000/axios', {
            params: {
              id: '我用params发送的id',
            },
          })
          .then((result) => {
            console.log(result.data)
          })
          .catch((err) => {})
      }
      var val = test()
      console.log(val)
    </script>
  </body>
</html>
